package com.xxjh.auth.mvc.filter;

import com.xxjh.auth.common.dto.LoginUserInfo;

/**
 * @author CHENCHEN
 * @title 线程栈存放用户信息
 * @company 新兴际华科技（天津）有限公司
 * @create 2024-07-03 19:21
 */
public class AccessContext {

    private static final ThreadLocal<LoginUserInfo> threadLocal = new ThreadLocal<>();

    public static void setThreadLocal(LoginUserInfo loginUserInfo) {
        threadLocal.set(loginUserInfo);
    }

    public static LoginUserInfo getThreadLocal() {
        return threadLocal.get();
    }

    public static void clearLoginUserInfo(){
        threadLocal.remove();
    }
}
